package com.bookstore.service.impl;

import com.bookstore.entity.UserMessage;
import com.bookstore.mapper.UserMessageMapper;
import com.bookstore.service.UserMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author Cofe
 * @Date 2022/4/21 18:10
 */
@Service
public class UserMessageServiceImpl implements UserMessageService{
    @Resource
    private UserMessageMapper umm;
    @Override
    public UserMessage findByUsername(String username) {
        UserMessage message = umm.findMessage(username);
        return message;
    }


    @Override
    public Integer insertuser(String username, String name) {
        int saveusermessage = umm.saveusermessage(username, name);
        return saveusermessage;
    }

    @Override
    public String updateuser(String username, String name, String address, String gender, int age, String mail, String phone) {
        Integer integer = umm.updateusermessage(username, name, address, gender, age, mail, phone);
        if(integer>0){
            return "success";
        }else{
            return "系统繁忙,请稍后重试...";
        }
    }
}
